package com.xiantm.study.thread.readwritelock;

public class ReaderThread extends Thread{
    private final Data data;

    public ReaderThread(Data data){
        this.data = data;
    }

    @Override
    public void run(){
        try {
            while (true){
                char[] chars = data.read();
                System.out.println(Thread.currentThread().getName() + "reads "+ String.valueOf(chars));
            }
        }catch (InterruptedException e){

        }
    }
}